﻿using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;

using SIG.Model;
using SIG.Data.UnitOfWork;
using SIG.Infrastructure.Cache;
using SIG.Data;
using System;

namespace SIG.Repository
{
    public class ProductPhotoRepository : Repository<ProductPhoto>, IProductPhotoRepository
    {
        IMainBCUnitOfWork _unitOfWork;
        private ICacheService _cacheService;
        public ProductPhotoRepository(IMainBCUnitOfWork unitOfWork, ICacheService cacheService) : base(unitOfWork) {
            if (unitOfWork == (IMainBCUnitOfWork)null)
                throw new ArgumentNullException("unitOfWork");
            if (cacheService == (ICacheService)null)
                throw new ArgumentNullException("cacheService");
            this._unitOfWork = unitOfWork;
            this._cacheService = cacheService;
        }

        //public IList<ProductPhoto> GetPhotosByProductId(int productId)
        //{
        //    return this.FindBy(p => p.ProductId == productId).OrderByDescending(p => p.Importance).ToList();
        //}
    }
}
